package com.rookie.im.server.utils;

import com.rookie.im.server.domain.dto.UserClientDto;

import io.netty.channel.Channel;
import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;

public class SessionSocketHolder {
    private static final Map<UserClientDto, Channel> store = new ConcurrentHashMap<>();
    public static void createUserSession(int appId, int clientType, String userId, String imei, Channel channel) {
        UserClientDto userClientDto = new UserClientDto(appId, clientType, userId, imei);
        store.put(userClientDto, channel);
    }
    public static void removeUserSession(int appId, int clientType, String userId, String imei) {
        UserClientDto userClientDto = new UserClientDto(appId, clientType, userId, imei);
        store.remove(userClientDto);
    }
}
